package top.yaofengqiao.springcloudsimple.payment.biz.domain.pay.model.valobj;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author yfq
 * @date 2024/6/15 15:09
 * @description
 */
@Getter
@AllArgsConstructor
public enum PaymentType {
    WEB("web", "web网站支付页面"),
    QR_CODE("qr_code", "内嵌二维码"),
    QR_CODE_LINK("qr_code_link", "内嵌二维码图片链接"),
    ;

    // 支付类型
    private final String payType;
    // 描述
    private final String desc;

    public static PaymentType determinePaymentType(String payType) {
        for (PaymentType value : PaymentType.values()) {
            if (value.getPayType().equals(payType)) return value;
        }

        return null;
    }
}
